#include "AppConfig.h"
#include <wx/config.h>

AppConfig::AppConfig() : overwrite_output(false)
{
    //ctor
    LoadConfigs();
}

AppConfig::~AppConfig()
{
}

bool AppConfig::SaveGenericConfig()
{
    wxConfigBase* config = wxConfigBase::Get();
    config->SetPath("/Generic");
    config->Write("overwrite_output", overwrite_output);
    config->Write("show_autocmds", show_autocmds);
    return true;
}

AppConfig& AppConfig::Get()
{
    static AppConfig config;
    return config;
}

bool AppConfig::LoadConfigs()
{
    wxConfigBase* config = wxConfigBase::Get();
    config->SetRecordDefaults();
    config->SetPath("/Generic");
    config->Read("overwrite_output", &overwrite_output, false);
    config->Read("show_autocmds", &show_autocmds, false);
    return false;
}
